﻿<h3>Authentication Flow</h3>

@if (Session["accessToken"] != null) {
<h4>Login Success!</h4>
<p>After authentication flow completes, you can call the helper methods that requires authentication by using the access token obtained:</p>

<pre class="code">
@@{
    var user = Foursquare.GetUser(Session["accessToken"].ToString());
}
&lt;p&gtHello @@user.FirstName !!!&lt;/p&gt;
</pre>

var user = Foursquare.GetUser(Session["accessToken"].ToString());
<p>Hello @user.FirstName !!!</p>

<div class="message info">
    <span><strong>Note: </strong>In a complete implementation, you should store the access token in a persistent storage (e.g. a database) to use it in future API calls.</span>
</div>
} else {    
    <div class="message info">
        You're not logged in with twitter, login by clicking the following @Foursquare.GetLoginLink("link", "~/LoginSuccess")
    </div>
}